package testops.top.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import testops.top.dao.UserDao;
import testops.top.mapper.UserMapper;

import java.beans.Transient;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public UserDao queryById(Long id){
        return userMapper.selectByPrimaryKey(id);
    }

    @Transactional
    public void saveUser(UserDao user){
        System.out.println("新增用户...");
        userMapper.insertSelective(user);
    }
}
